package DesignPatern.A09_命令模式.QSB.A02_抽象模式;

/**
 * @Author: Du
 * @Date: 2021/7/23 15:14
 */
public class A01_Main
{
    public static void main(String[] args)
    {
        Invoker invoker = new Invoker();
        Receiver receiver = new ConcreteReceiver1();
        Command command1 = new ConcreteCommand1(receiver);
        
        invoker.setCommand(command1);//调用者和接收命令者没有任何依赖关系
        invoker.action();
        
        Command command2 = new ConcreteCommand2(new ConcreteReceiver2());
        invoker.setCommand(command2);
        invoker.action();
    }
}
